{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "from dataset.dataset import MyDataset\n",
    "from torch.utils.data import DataLoader"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(1024, dtype=torch.int32)\n",
      "tensor(910, dtype=torch.int32)\n",
      "tensor(796, dtype=torch.int32)\n",
      "tensor(683, dtype=torch.int32)\n",
      "tensor(569, dtype=torch.int32)\n",
      "tensor(456, dtype=torch.int32)\n",
      "tensor(342, dtype=torch.int32)\n",
      "tensor(229, dtype=torch.int32)\n",
      "tensor(115, dtype=torch.int32)\n",
      "tensor(2, dtype=torch.int32)\n"
     ]
    }
   ],
   "source": [
    "for i in torch.linspace(1024,2,10).to(dtype=torch.int32):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = 'data/test.json'\n",
    "dataset = MyDataset(path)\n",
    "dataloader = DataLoader(dataset, batch_size=16, shuffle=False, drop_last=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(0.)\n",
      "tensor(1, dtype=torch.int32)\n"
     ]
    }
   ],
   "source": [
    "for item in dataloader:\n",
    "    # print(item)\n",
    "    # print(type(item))\n",
    "    img = item[0]\n",
    "    label = item[1]\n",
    "    print(img.min())\n",
    "    print(label.min())\n",
    "    break"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "29e1e0f433528b30d0029eb6eb3077f94c7f86e16287bd20a9728025e03018be"
  },
  "kernelspec": {
   "display_name": "Python 3.6.13 64-bit ('hp': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
